#ifndef _BINARY_TREE_H
#define _BINARY_TREE_H


#include "Typedef.h"

/********************************************************** 
              STRUCTURES
***********************************************************/
/*! @brief Node structure */
typedef struct Node
{
  int   _element;
  Node *_left_node_ptr;
  Node *_right_node_ptr;
} Node;

/*! @brief Binary Tree structure */
typedef struct Binary_Tree
{
  Node *_root_ptr;
  uint  _size;
} Binary_Tree;

/********************************************************** 
              FUNCTIONS
***********************************************************/
/*! @brief Function to initialize the binary tree */
void init_binary_tree(void);

/*! @brief Function that returns the size of the tree */
uint size(void);

/*! @brief Inserts an element into the tree 
    @return true if inserted, false otherwise
 */
bool insert_element
(
  int element
);

/*! @brief Deletes an element from the tree 
    @return true if deleted from the tree,
            false otherwise
  */
bool delete_element
(
  int element
);

/*! @brief Finds an element from the tree 
    @return NULL if not found.
  */
Node* find_element
(
  int element
);


#endif /* _BINARY_TREE_H */
